Unicorn redis config fix 2

jamesperet 9 years ago
parent
commit
9fba4b3cd1
1 changed files with 3 additions and 1 deletions
  1. 3 1
      config/unicorn.rb

+ 3 - 1
config/unicorn.rb

@@ -28,7 +28,9 @@ after_fork do |server, worker|
28 28
  
29 29
   # If you are using Redis but not Resque, change this
30 30
   if defined?(Resque)
31
-    Resque.redis = ENV['REDISTOGO_URL']
31
+    uri = URI.parse(ENV["REDISTOGO_URL"])
32
+    redis = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password)
33
+    Resque.redis = redis
32 34
     Rails.logger.info('Connected to Redis')
33 35
   end
34 36
 end